package request;

import core.Constants;
import core.GameBoard;
import core.GameCharacter;
import core.GameMode;
import core.GameQuestion;
import core.GameUser;

import java.io.OutputStream;

import response.ResponseQuestionLog;

/**
 * RequestQuestionLog
 * @author brian
 */
public class RequestQuestionLog extends GameRequest {

    private GameUser user;
    private GameCharacter character;
    private int charID = -1;

    public RequestQuestionLog() {
        code = Constants.CMSG_QUESTION_LOG;
    }

    public void parse() {
        user = client.getUser(); 
        character = user.getCharacter();
        charID = character.getID();
    }

    public void respond(OutputStream output) {
            ResponseQuestionLog response = new ResponseQuestionLog();
            response.set(gameServer);
            response.setOut(output);
            response.setQuestionLog(gameServer.getGameDB().getQuestionLog(charID, -1));
            response.run();
    }
}
